<?php

include_once("../model/Suggestion.php");
include_once("../dao/SuggestionDAO.php");

class ViewCommand {

    public function getSuggestionList() {

        $suggestionDao = new SuggestionDAO();
        $suggestionList = $suggestionDao->getAllSuggestions();
        
        if(empty($suggestionList)){
             return array(
            "1" => new Suggestion("1", "AppleSug", "Author1", "desc1."),
            "2" => new Suggestion("2", "AndriodSug", "Author2", "desc2"),
            "3" => new Suggestion("3", "WindowsSug", "Author3", "desc3")
        );
        }else{ 
            return $suggestionList;
        }
    }

    public function getSuggestionByID($id) {
        $allSuggestions = $this->getSuggestionList();
        return $allSuggestions[$id];
    }

}

?>